package se.miun.dt156g.antonsskafferibestallning;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageButton;


public class LunchTableActivity extends Activity implements OnClickListener {

	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_get_order);
		
		Button table1 = (Button)findViewById(R.id.bTable1);
		table1.setOnClickListener(this);
		Button table2 = (Button)findViewById(R.id.bTable2);
		table2.setOnClickListener(this);
		Button table3 = (Button)findViewById(R.id.bTable3);
		table3.setOnClickListener(this);
		Button table4 = (Button)findViewById(R.id.bTable4);
		table4.setOnClickListener(this);
		Button table5 = (Button)findViewById(R.id.bTable5);
		table5.setOnClickListener(this);
		Button table6 = (Button)findViewById(R.id.bTable6);
		table6.setOnClickListener(this);
		Button table7 = (Button)findViewById(R.id.bTable7);
		table7.setOnClickListener(this);
		Button table8 = (Button)findViewById(R.id.bTable8);
		table8.setOnClickListener(this);
		Button table9 = (Button)findViewById(R.id.bTable9);
		table9.setOnClickListener(this);
		Button table10 = (Button)findViewById(R.id.bTable10);
		table10.setOnClickListener(this);
		
	}

		@Override
		public void onClick(View v) {
			Intent startLunchOrderActivity = new Intent(this, LunchOrderActivity.class);
			switch (v.getId()) {
				case R.id.bTable1:
					startLunchOrderActivity.putExtra("TableNo", 1);
					break;
				case R.id.bTable2:
					startLunchOrderActivity.putExtra("TableNo", 2);
					break;
				case R.id.bTable3:
					startLunchOrderActivity.putExtra("TableNo", 3);
					break;
				case R.id.bTable4:
					startLunchOrderActivity.putExtra("TableNo", 4);
					break;
				case R.id.bTable5:
					startLunchOrderActivity.putExtra("TableNo", 5);
					break;
				case R.id.bTable6:
					startLunchOrderActivity.putExtra("TableNo", 6);
					break;
				case R.id.bTable7:
					startLunchOrderActivity.putExtra("TableNo", 7);
					break;
				case R.id.bTable8:
					startLunchOrderActivity.putExtra("TableNo", 8);
					break;
				case R.id.bTable9:
					startLunchOrderActivity.putExtra("TableNo", 9);
					break;
				case R.id.bTable10:
					startLunchOrderActivity.putExtra("TableNo", 10);
					break;
				default:
					break;
			}
			startActivity(startLunchOrderActivity);
			finish();
		}

}
